// // https://vitepress.dev/guide/custom-theme
// import { h } from 'vue'
// import Theme from 'vitepress/theme'
// import './style.css'
//
// export default {
//   ...Theme,
//   Layout: () => {
//     return h(Theme.Layout, null, {
//       // https://vitepress.dev/guide/extending-default-theme#layout-slots
//     })
//   },
//   enhanceApp({ app, router, siteData }) {
//     // ...
//   }
// }


//.vitepress/theme/index.ts
import { watch } from 'vue'
import type { Theme } from 'vitepress'
import DefaultTheme from 'vitepress/theme'
import './style.css'
import Layout from './Layout/index.vue'

let homePageStyle: HTMLStyleElement | undefined

export default {
  extends: DefaultTheme,
  Layout: Layout,
  enhanceApp({ router }: EnhanceAppContext) {
    if (typeof window === 'undefined') return
    watch(
      () => router.route.data.relativePath,
      { immediate: true },
    )
  },
} satisfies Theme
